<template>
  <z-paging ref="paging" v-model="goodsList" @query="queryList">
    <view class="df container">
      <!-- 左侧滚动视图区域 -->
      <scroll-view
        class="left-scroll-view"
        scroll-y="true"
        :style="{ height: wh + 'px' }"
      >
        <view class="left-scroll-view-item active">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
      </scroll-view>
      <!-- 右侧的滚动视图区域 -->
      <scroll-view
        class="left-scroll-view"
        scroll-y="true"
        :style="{ height: wh + 'px' }"
      >
        <view class="left-scroll-view-item active">zzzz</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
        <view class="left-scroll-view-item">xxx</view>
      </scroll-view>
    </view>
  </z-paging>
</template>
<script setup lang="ts">
import { onLoad } from "@dcloudio/uni-app";
onLoad(() => {
  //获取当前系统的信息
  const sysInfo = uni.getSystemInfoSync();
  console.log(sysInfo);
  //为wh窗口可用高度动态赋值
  const wh = sysInfo.windowHeight;
});

const queryList = (pageNo, pageSize) => {
  const params = {
    currentPage: pageNo,
    pageSize: pageSize,
  };
  goodsListApi(params)
    .then((res) => {
      paging.value.complete(res.records);
      // console.log(goodsList.value);
    })
    .catch((res) => {
      paging.value.complete(false);
    });
};
</script>
<style lang="scss" scoped>
.container {
  .left-scroll-view {
    width: 200rpx;
  }
}
</style>
